package com.chenyun.common.vo;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

import java.util.Map;




/**
 * 前端参数封装类
 */
@ApiModel("前端参数封装类,传入的查询条件")
public class QueryPage {

    /**
     * 页码
     */
    @ApiModelProperty("页码")
    private int pageIndex;
    private int pageNum;
    /**
     * 页大小
     */
    @ApiModelProperty("页大小")
    private int pageSize;

    /**
     * 约定
     * 如果包含时间查询 则格式为 时间属性_startTime,时间属性_endTime,
     */
    @ApiModelProperty("查询条件 ,vaule是字符串")
    private Map<String, PageFilter> filter;
    /**
     * 排序字段
     * 格式: name desc | name asc
     */
    private String orderBy;


    public int getPageIndex() {
        if (pageIndex==0&&pageNum!=0){
            return pageNum;
        }
        return pageIndex;
    }

    public void setPageIndex(int pageIndex) {
        this.pageIndex = pageIndex;
    }

    public int getPageNum() {
        return pageNum;
    }

    public void setPageNum(int pageNum) {
        this.pageNum = pageNum;
    }

    public int getPageSize() {
        return pageSize;
    }

    public void setPageSize(int pageSize) {
        this.pageSize = pageSize;
    }

    public Map<String, PageFilter> getFilter() {
        return filter;
    }

    public void setFilter(Map<String, PageFilter> filter) {
        this.filter = filter;
    }

    public String getOrderBy() {
        return orderBy;
    }

    public void setOrderBy(String orderBy) {
        this.orderBy = orderBy;
    }
}
